//
//  VideoGenerateResultCell.swift
//  NDAi
//
//  Created by 丸子 on 2024/6/21.
//

import UIKit

class VideoGenerateResultCell: UITableViewCell {
    
    lazy var lineView: UIView = {
        let view = UIView()
        view.backgroundColor = Theme.color.main
        view.allRound(3)
        return view
    }()
    
    lazy var titleLb: UILabel = {
        let label = UILabel()
        label.font = UIFont.pingFangSCRegular(ofSize: 15)
        label.textColor = Theme.color.main
        label.text = "生成结果"
        return label
    }()
    
     lazy var copyBtn: UIButton = {
        let button = UIButton(type: .custom)
        button.normalImage = UIImage(named: "icon_video_copy")
        button.titleFont = UIFont.pingFangSCMedium(ofSize: 16)
        return button
    }()
    
    lazy var content: UIView = {
        let view = UIView()
        view.allRound(8)
        view.backgroundColor = UIColor.white
        return view
    }()
    
    lazy var contentLb: UILabel = {
        let label = UILabel()
        label.font = UIFont.pingFangSCRegular(ofSize: 13)
        label.textColor = Theme.color.text_d1
        label.text = ""
        label.numberOfLines = 0
        return label
    }()
    
    override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
        super.init(style: style, reuseIdentifier: reuseIdentifier)
        self.backgroundColor = .clear
        self.selectionStyle = .none
        self.contentView.addSubviews([titleLb, lineView, content, copyBtn])
        content.addSubview(contentLb)
        
        lineView.snp.makeConstraints { make in
            make.top.equalTo(22)
            make.leading.equalTo(16)
            make.height.equalTo(16)
            make.width.equalTo(6)
        }
        
        titleLb.snp.makeConstraints { make in
            make.centerY.equalTo(lineView)
            make.leading.equalTo(lineView.snp.trailing).offset(8)
        }
        
        copyBtn.snp.makeConstraints { make in
            make.centerY.equalTo(titleLb)
            make.trailing.equalToSuperview().offset(-16)
            make.width.height.equalTo(27)
        }
        
        content.snp.makeConstraints { make in
            make.top.equalTo(lineView.snp.bottom).offset(12)
            make.leading.trailing.equalToSuperview().inset(16)
            make.bottom.equalTo(contentLb.snp.bottom).offset(16)
        }
        
        contentLb.snp.makeConstraints { make in
            make.top.equalTo(8)
            make.leading.trailing.equalToSuperview().inset(16)
        }
    }
    
    required init?(coder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
}
